//
//  XGStatusPostContentTableViewCell.swift
//  TodayNews
//
//  Created by monkey on 2020/2/24.
//  Copyright © 2020 itcast. All rights reserved.
//

import UIKit

class XGStatusPostContentTableViewCell: XGBaseStatusTableViewCell
{
    /// 重写父类属性 会自动触发父类didSet
    override var statusViewModel: XGStatusViewModel? {
        didSet {
            statusPictureView.thumbImageList = statusViewModel?.thumbImageList
            statusPictureView.largeImagelist = statusViewModel?.largeImagelist
            statusPictureView.isHidden = statusViewModel?.thumbImageList?.count == 0
            statusPictureView.snp.updateConstraints { (make) in
                make.height.equalTo(statusViewModel!.picturesViewSize.height)
            }
        }
    }
    
    override func setUpUI()
    {
        super.setUpUI()
        
        contentView.addSubview(statusPictureView)
        statusPictureView.snp.makeConstraints { (make) in
            make.top.equalTo(contentLabel.snp.bottom)
            make.left.right.equalToSuperview()
            make.height.equalTo(0)
        }
    }
    
    /// 配图视图
    private lazy var statusPictureView: XGStatusPicturesView = XGStatusPicturesView()
}
